package com.shangcheng.model.vo;

import cn.hutool.core.bean.BeanUtil;
import com.shangcheng.model.domain.SmsFlashPromotionSession;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SmsFlashPromotionSessionVo  implements Serializable {

    private Integer id;
    private String name;
    private Date startTime;
    private Date endTime;
    private Integer status;
    private Date createTime;

    private Integer productCount;

    //进行对象的封装
    public static SmsFlashPromotionSessionVo init(SmsFlashPromotionSession smsFlashPromotionSession
            , Integer productCount) {
        SmsFlashPromotionSessionVo vo = new SmsFlashPromotionSessionVo();
        BeanUtil.copyProperties(smsFlashPromotionSession, vo);
        vo.setProductCount(productCount);
        return vo;
    }
}
